//
//  UIButton+ZJCategory.h
//  Button_链式
//
//  Created by zhengju on 2017/4/16.
//  Copyright © 2017年 郑俱. All rights reserved.
//

#import <UIKit/UIKit.h>


#define ADD_TO_SUPERVIEW
#define DEFAULT_NO
#define DEFAULT_YES
#define AUTOLAYOUT_SET_NO

typedef void (^ActionBlock)(id sender);

@interface UIButton (ZJCategory)

#pragma mark - UIView
-(UIButton* (^) (CGRect frame))home_frame;

-(UIButton* (^) (CGRect frame))home_bounds;

-(UIButton* (^) (UIColor * backgroundColor))home_backgroundColor;

-(UIButton* (^) (CGPoint center))home_center;

-(UIButton* (^) (NSInteger tag))home_tag;

-(UIButton* (^) (CGFloat cornerRadius))home_cornerRadius;

-(UIButton* (^) (__kindof UIView *superView)) ADD_TO_SUPERVIEW home_superView;

-(UIButton* (^) (BOOL hidden)) DEFAULT_NO home_hidden;

-(UIButton* (^) (BOOL hidden)) DEFAULT_NO home_clipsToBounds;

-(UIButton* (^) (BOOL hidden)) DEFAULT_NO home_userInteractionEnabled;

-(UIButton* (^) (BOOL hidden)) DEFAULT_YES home_translatesAutoresizingMaskIntoConstraints AUTOLAYOUT_SET_NO;

-(UIButton* (^) (CGFloat alpha))home_alpha;

-(UIButton* (^) (UIViewContentMode contentMode))home_contentMode;

-(UIButton* (^) (CGAffineTransform transform))home_transform;

-(UIButton* (^) (UISemanticContentAttribute semanticContentAttribute))home_semanticContentAttribute;

-(UIButton* (^) (CGFloat contentScaleFactor))home_contentScaleFactor;

-(UIButton* (^) (BOOL multipleTouchEnabled))home_multipleTouchEnabled; // default is NO

-(UIButton* (^) (BOOL exclusiveTouch))home_exclusiveTouch; // default is NO

-(UIButton* (^) (BOOL autoresizesSubviews))home_autoresizesSubviews; // default is YES. if set, subviews are adjusted according to their autoresizingMask if self.bounds changes

-(UIButton* (^) (UIViewAutoresizing autoresizingMask))home_autoresizingMask; // simple resize. default is UIViewAutoresizingNone

-(UIButton* (^) (UIEdgeInsets layoutMargins))home_layoutMargins;

-(UIButton* (^) (BOOL preservesSuperviewLayoutMargins))home_preservesSuperviewLayoutMargins; // default is NO - set to enable pass-through or cascading behavior of margins from this view’s parent to its children

-(UIButton* (^) (BOOL opaque))home_opaque; // default is YES. opaque views must fill their entire bounds or the results are undefined. the active CGContext in drawRect: will not have been cleared and may have non-zeroed pixels

-(UIButton* (^) (BOOL clearsContextBeforeDrawing))home_clearsContextBeforeDrawing; // default is YES. ignored for opaque views. for non-opaque views causes the active CGContext in drawRect: to be pre-filled with transparent pixels

-(UIButton* (^) (UIView *maskView))home_maskView;

-(UIButton* (^) (UIViewTintAdjustmentMode tintAdjustmentMode))home_tintAdjustmentMode;

-(UIButton* (^) (NSArray<__kindof UIGestureRecognizer *> *gestureRecognizers))home_gestureRecognizers;

-(UIButton* (^) (NSArray<__kindof UIMotionEffect *> *motionEffects))home_motionEffects;

-(UIButton* (^) (NSString *restorationIdentifier))home_restorationIdentifier;

#pragma mark - UIControl
-(UIButton* (^) (BOOL enabled))home_enabled; // default is YES. if NO, ignores touch events and subclasses may draw differently

-(UIButton* (^) (BOOL selected))home_selected; // default is NO may be used by some subclasses or by application

-(UIButton* (^) (BOOL highlighted))home_highlighted; // default is NO. this gets set/cleared automatically when touch enters/exits during tracking and cleared on up

-(UIButton* (^) (UIControlContentVerticalAlignment contentVerticalAlignment))home_contentVerticalAlignment; // how to position content vertically inside control. default is center

-(UIButton* (^) (UIControlContentHorizontalAlignment contentHorizontalAlignment))home_contentHorizontalAlignment; // how to position content hozontally inside control. default is center

#pragma mark - UIButton

-(UIButton * (^) (NSString *text))home_text;

-(UIButton* (^) (UIEdgeInsets contentEdgeInsets))home_contentEdgeInsets; // default is UIEdgeInsetsZero

-(UIButton* (^) (UIEdgeInsets titleEdgeInsets))home_titleEdgeInsets; // default is UIEdgeInsetsZero

-(UIButton* (^) (BOOL reversesTitleShadowWhenHighlighted))home_reversesTitleShadowWhenHighlighted; // default is NO. if YES, shadow reverses to shift between engrave and emboss appearance

-(UIButton* (^) (UIEdgeInsets imageEdgeInsets))home_imageEdgeInsets; // default is UIEdgeInsetsZero

-(UIButton* (^) (BOOL adjustsImageWhenHighlighted))home_adjustsImageWhenHighlighted; // default is YES. if YES, image is drawn darker when highlighted(pressed)

-(UIButton* (^) (BOOL adjustsImageWhenDisabled))home_adjustsImageWhenDisabled; // default is YES. if YES, image is drawn lighter when disabled

-(UIButton* (^) (BOOL showsTouchWhenHighlighted))home_showsTouchWhenHighlighted; // default is NO. if YES, show a simple feedback (currently a glow) while highlighted

-(UIButton* (^) (UIColor *tintColor))home_tintColor; // The tintColor is inherited through the superview hierarchy. See UIView for more information.

-(UIButton* (^) (ActionBlock block))home_block;//default is UIControlEventTouchUpInside.

@end
